/**
 * @author: sce
 * @description: 菜单表
 */

import * as mongoose from 'mongoose';

const Schema = mongoose.Schema;

const MenuSchema = new Schema({
    // 菜单名称
    menu_name: {
        type: String,
        required: true
    },
    // 菜单图标
    menu_icon: {
        type: String
    },
    // 菜单级别
    menu_level: {
        type: Number,
        required: true
    },
    // 父级菜单
    parent_id: {
        type: Schema.Types.ObjectId
    },
    // 路由
    menu_route: {
        type: String
    },
    // 备注
    memo: {
        type: String
    },
    // 菜单状态 备用
    status: {
        type: Number,
        default: 0
    },
    // 创建日期
    create_at: { type: Date, default: Date.now },
    // 更新日期
    update_at: { type: Date, default: Date.now }
});

mongoose.model('Menu', MenuSchema);